package com.mtw.bbs.userAdmin.feign;


import com.mtw.bbs.common.core.vo.Result;
import com.mtw.bbs.common.web.interceptor.BaseFeignInterceptor;
import com.mtw.bbs.userAdmin.pojo.vo.MenuVo;
import com.mtw.bbs.userAdmin.pojo.vo.ResourceVo;
import com.mtw.bbs.userAdmin.pojo.vo.RoleVo;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
import static com.mtw.bbs.common.core.constant.ApiPrefix.*;

/**
 * resource Feign接口类
 */
@FeignClient(
        value = "bbs-user",
        contextId = "resourceClientI",
        configuration = BaseFeignInterceptor.class,
        fallback = ResourceClientFallback.class
)
public interface ResourceClient {


    @ApiOperation(value = "查询用户拥有的菜单", notes = "根据用户id查询用户拥有的菜单")
    @GetMapping(value = API_PREFIX_RESOURCE+"/getMenu")
    Result<List<MenuVo>> getMenu(@RequestParam("userId") String userId);



    @ApiOperation(value = "查询用户拥有的按钮", notes = "根据用户id查询用户拥有的按钮")
    @GetMapping(value = API_PREFIX_RESOURCE+"/getButton")
    Result<List<MenuVo>> getButton(@RequestParam("userId") String userId);




    @ApiOperation(value = "查询用户拥有的权限", notes = "根据用户id查询用户拥有的权限url")
    @GetMapping(value = API_PREFIX_RESOURCE + "/user")
    Result<List<ResourceVo>> queryResourceByUser(@RequestParam String userId);





    @ApiOperation(value = "查询用户拥有的角色", notes = "根据用户id查询用户所拥有的角色")
    @GetMapping(value = API_PREFIX_RESOURCE + "/role")
    Result<List<RoleVo>> queryRoleByUser(@RequestParam String userId);



}
